package com.lgx.mall.business.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.lgx.common.entity.IdGenerator;
import com.lgx.right.entity.Organization;
import com.lgx.right.entity.User;

/**
 * 兑换信息
 * 
 * @author acer
 *
 */
@Entity
@Table(name="TM_EXCHANGEINFO")
public class ExchangeInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final String CHARGEINDEX_DHLX_MERCHANT="01";//联盟商家兑换
	public static final String CHARGEINDEX_DHLX_TGZ = "02";//推广站兑换
	public static final String CHARGEINDEX_DHLX_TGCENTER = "03";//推广中心兑换
	public static final String CHARGEINDEX_DHLX_YYCENTER = "04";//运营中心兑换
	
	public static final String CHARGEINDEX_DHFS_HANDLERJF = "01";//兑换成积分
	public static final String CHARGEINDEX_DHFS_HANDLERJQ = "02";//兑换成人民币
	
	public static final int CHARGEINDEX_DHZT_INIT = 0;
	public static final int CHARGEINDEX_DHZT_OVER = 1;
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator=IdGenerator.CHARGEINDEX_ID_GENERATOR)
	@TableGenerator(
			name = IdGenerator.CHARGEINDEX_ID_GENERATOR,
			table = IdGenerator.GENERATOR_TABLE,
			pkColumnName = IdGenerator.GEN_NAME,
			pkColumnValue = IdGenerator.CHARGEINDEX_ID_GENERATOR,
			valueColumnName = IdGenerator.GEN_VALUE,
			initialValue = 1,
			allocationSize = 1
	)
	private long id;
	
	private String type;//兑换类型
	
	private Date commitDate;//兑换提交日期
	
	@ManyToOne
	@JoinColumn(name="commiter_id")
	private User commiter;//兑换提交人
	
	private double score;//兑换积分数
	
	private double receive;//获得现金或者积分数
	
	@ManyToOne
	@JoinColumn(name="org_id")
	private Organization org;//兑换机构
	
	@ManyToOne
	@JoinColumn(name="confirmor_id")
	private User confirmor;//兑换确认人
	
	private Date confirmDate;//兑换确认日期
	
	private int status;//兑换状态
	
	private String way;//兑换方式
	
	private String isDelete;//兑换是否成功  公司员工是否否定 默认作废不显示
	
	@ManyToOne
	@JoinColumn(name="merchant_id")
	private Organization merchant;//兑换的联盟商家

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getCommitDate() {
		return commitDate;
	}

	public void setCommitDate(Date commitDate) {
		this.commitDate = commitDate;
	}

	public User getCommiter() {
		return commiter;
	}

	public void setCommiter(User commiter) {
		this.commiter = commiter;
	}

	public double getScore() {
		return score;
	}

	public void setScore(double score) {
		this.score = score;
	}

	public double getReceive() {
		return receive;
	}

	public void setReceive(double receive) {
		this.receive = receive;
	}

	public Organization getOrg() {
		return org;
	}

	public void setOrg(Organization org) {
		this.org = org;
	}

	public User getConfirmor() {
		return confirmor;
	}

	public void setConfirmor(User confirmor) {
		this.confirmor = confirmor;
	}

	public Date getConfirmDate() {
		return confirmDate;
	}

	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getWay() {
		return way;
	}

	public void setWay(String way) {
		this.way = way;
	}

	public String getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(String isDelete) {
		this.isDelete = isDelete;
	}

	public Organization getMerchant() {
		return merchant;
	}

	public void setMerchant(Organization merchant) {
		this.merchant = merchant;
	}
}
